package com.zxg.zbc.dal.dao.concurrent;

import com.zxg.zbc.dal.dao.exception.DAOException;
import com.zxg.zbc.dal.dataobject.concurrent.LastProcessed;
import com.zxg.zbc.dal.dataobject.concurrent.Lock;

public interface ConcurrentDao {

  public boolean lock(String host, Lock.ConcurrentType type, Integer timeout) throws DAOException;

  public boolean unlock(String host, Lock.ConcurrentType type) throws DAOException;

  public Lock getLockByType(Lock.ConcurrentType type) throws DAOException;

  public Lock insertLock(Lock lock) throws DAOException;

  public LastProcessed getLastProcessedByType(Lock.ConcurrentType type) throws DAOException;

  public Integer updateLastProcessed(LastProcessed lastProcessed) throws DAOException;

  public LastProcessed insertLastProcessed(LastProcessed lastProcessed) throws DAOException;
}
